package Java.BlackHorse.IO.BufferStream;

import java.io.*;

public class IODemo2 {
    /*
    * 利用 字节缓冲流 一次读取多个数据
    * */
    public static void main(String[] args) throws IOException {
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("IO\\BufferStream\\b.txt"));
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("IO\\BufferStream\\a.txt"));
        int len;
        byte[] bytes = new byte[4];
        while((len = bis.read(bytes)) != -1){
            bos.write(bytes,0,len);
        }
        bis.close();
        bos.close();
    }
}
